{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "67cd69c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6e2cff3b524b4502836778fbd1dc20da",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d9ff36d5d6104f45a0bc2d5c90852468",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eb58c2015f5f469d9569016606a9a751",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c702e87b289d480ebec63bb34d962b55",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bdffc6b9a4e94b20b7a8035f1d034a4a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "74cc504629d14ebdaa12fec44e9886b8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e7ab71fd0059424fb16ec04e45570316",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "19c6ae9a43674d499fdcd517718a3572",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8a07e54ba53c41ffb1ab4db597865ab3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cd4c83729c32489ca733aca84f7e3b9a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "30ec646599b647f08dbfeda16aa16111",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "91500694a2474191aa0ec996f249633d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a487200419864b87b450d4eda2b57339",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eca2f847aa1d454eb0bb0f52f8623b90",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a0195810a54a430180cdfbd66501a9c7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "edd1d7fd079744bba4a07b5ef6ca5c08",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5eae4a9476704bb3981088b0a8c9c242",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c3894d03eb05404d9b9e1b6046982cf1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f433e64c9bb74b2b8a14278e9dc43df8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "404a6199abbb4e8b8cd90f1f7490ab49",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d3fdc4f7c51b47d3b3b470fb07e21c8b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1fb8c89fac4d46d79d0921d0d95fc794",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ef1663fab98b45d889ecf6d4f1b908db",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "629899ac549f4cf38a3928dd796a4eec",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "396f273d71ed4c8f987c82011902ff6d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "48572406d324494299aad57210949167",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a0e382f910db418b966813ac87f11b37",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "286cc539df694935aa7d20200ea23239",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3bf4abb917544a46a73e8ee95e91089c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "745f0ae51a7a41e69ad99742b1d31c02",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "78f675b6f01c4f438243db6aa7d62d5f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ec10b08d31d54d4faf9fcc7cd3adfbfb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4a1a90120d204d4294fbbf2eede07f9a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4f8e76cecffb4ce8a907754fdd4f3908",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ec381f5f1da440a0b4d0807224281ba8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e43d08f2a2f1413d9c85523d69ef3112",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5febd81e500442b7977f909f6b13d929",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "74bca2ce84ae489981abaeca8bb4c579",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "db344e37f29c4f27b3cd5dbf39ae8bbe",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a6c5cc32e44c49189d5ae5cf7c027b06",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "dfa9e7ef195f42649df54149e2767c4e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "540766f837d144629c454f6a17070d8b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8bc5b40c8904420db1036714b93496f4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f5a08d83edcd424e928c9e0f6b105d91",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bab837c818834a04ad105c1fa358d146",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "60cc5929f60449578d386861746efcef",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bc876a30d8164792b60f13a595603d46",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cf1bccefe4d04a9f950bf5f74bfcb2d4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "801fec426dea49fda9e3967cef6bdf5f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "86d33b2b67f94f3b917912df256d6f01",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3b157757b86f4fdaaedb1bcdebddbe35",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fcd9e272155440c6a6e2d09450ab5271",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eb0d8c77c51b49e9857e34d1726401a3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "573e2b1b3c5c4146985993cff56338bb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "db06e717865143068e49421710806509",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8e27e8cefacc4bdf8fc2cd247398a8ec",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "794c6f477cf04ea7ab0a23472cfffb59",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4b3c18c9022143848aa77b157b925bd4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1e2dced8fc2b46debcbb1477333fc473",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "40711c6a77b24e7486f6face3666bfcb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7119b9969c7a414eb08c915e6ac7fb99",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a96a11157644401b9e92e89472b07da1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b778c85183104e54b19d2d86e1a1fc20",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fb4d346df4cb4b268beb9e6de470af1a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "351ff1d56718448c908f2e3689d55273",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8a82545f31db43d6b7a0fe01db5cb746",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d3895b0a2267432c9150c9b375383fb5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ad01297ce4d644aebdd03207291d4c47",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "340a44e4b8664220a44209b6f1bd0298",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "705a1d8dfc1e48a1991e3884f475ab17",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5db2c82e2787452882ea5ac1c98a7858",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "25bce453479049df9d365e94b563c0dc",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "25c92c8dd9154e23818f0600c3c4a31d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6689635aa326481eb4254c0cd4c2aacd",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c313f14dcb2d4b13960047f24497f479",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "64f648b227b346e7afe5a86203a63c9b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5184ff1895ad493a9a11cfa3a030bc2d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e9222d27d70a48de802605397ec3d879",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4e3f1997ab204a71a8c7594028a76a5c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a501a2643a2b4e1b9269963205fad7fc",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "37e3aa4c2d73484eaa0fe54be0c40c41",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "019b65a45f4d433098ca35e5065e5f4e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5618da05b2d6481eb6ce784d037a2da7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "624301ec2664460294a84d516bb36025",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "92105564f10146deb01432ca2b22ba77",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8663523218084db5abf35cff8e2aa006",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "633afcfd6e274f36ae508565159f0e11",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d79cb581fbdc4581986196ca3e644c70",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d40820a70bac4c348dff143b570efc1d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4879dee2c383474ea90fd65be9fd4efe",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/1 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "符合底背离条件的板块数量（单位：month，比较周期数：2，偏移：0）： 0\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\liangcheng\\AppData\\Local\\Temp\\ipykernel_19044\\3039017679.py:33: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n"
     ]
    },
    {
     "ename": "",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
      "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
      "\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
      "\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
     ]
    }
   ],
   "source": [
    "import akshare as ak\n",
    "import pandas as pd\n",
    "import datetime\n",
    "\n",
    "# 参数设置\n",
    "offset_unit = 'month'       # 选项: 'day', 'week', 'month'\n",
    "compare_periods = 2       # 比较几个周期（第2、第3、第4）\n",
    "compare_offset = 0        # 偏移多少个周期（跳过最近的几个周期）\n",
    "\n",
    "industry_df = ak.stock_board_industry_name_ths()\n",
    "industry_list = industry_df[\"name\"].tolist()\n",
    "\n",
    "today = datetime.datetime.today()\n",
    "start_date = (today - pd.DateOffset(months=6)).strftime('%Y%m%d')\n",
    "end_date = today.strftime('%Y%m%d')\n",
    "\n",
    "# 设置resample规则\n",
    "resample_rule = {\n",
    "    'day': '1D',\n",
    "    'week': 'W-FRI',\n",
    "    'month': 'M'\n",
    "}[offset_unit]\n",
    "\n",
    "result = []\n",
    "\n",
    "for symbol in industry_list:\n",
    "    df = ak.stock_board_industry_index_ths(symbol=symbol, start_date=start_date, end_date=end_date)\n",
    "    df = df.rename(columns={\"收盘价\": \"close\", \"成交量\": \"volume\"})\n",
    "    df[\"日期\"] = pd.to_datetime(df[\"日期\"])\n",
    "    df = df.sort_values(\"日期\").reset_index(drop=True)\n",
    "\n",
    "    # 重采样\n",
    "    resampled = df.set_index(\"日期\").resample(resample_rule).agg({\n",
    "        'close': 'last',\n",
    "        'volume': 'sum'\n",
    "    }).dropna()\n",
    "\n",
    "    if len(resampled) < compare_periods + compare_offset:\n",
    "        continue\n",
    "\n",
    "    # 获取对比数据（跳过最近 offset 周期）\n",
    "    start_idx = -compare_periods - compare_offset\n",
    "    end_idx = -compare_offset if compare_offset > 0 else None\n",
    "    recent = resampled.iloc[start_idx:end_idx]\n",
    "\n",
    "    closes = recent[\"close\"].values\n",
    "    volumes = recent[\"volume\"].values\n",
    "\n",
    "    if all(closes[i] > closes[i + 1] for i in range(compare_periods - 1)) and \\\n",
    "       all(volumes[i] < volumes[i + 1] for i in range(compare_periods - 1)):\n",
    "        result.append(symbol)\n",
    "\n",
    "# 打印结果\n",
    "print(f\"符合底背离条件的板块数量（单位：{offset_unit}，比较周期数：{compare_periods}，偏移：{compare_offset}）：\", len(result))\n",
    "print(*result, sep='\\n')\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
